﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.BizTalk.ExplorerOM;
using DBLOG.BizTalk.BizTalkExplorerServices.Core;

namespace DBLOG.BizTalk.BizTalkExplorerServices.Explorers
{
    public class ReceiveLocationExplorer : BizTalkExplorerBase
    {
        public List<ReceiveLocation> GetDisabledReceiveLocations()
        {
            List<ReceiveLocation> disabledReceiveLocations = new List<ReceiveLocation>();

            foreach (ReceivePort receivePort in this._explorer.ReceivePorts)
            {
                foreach (ReceiveLocation location in receivePort.ReceiveLocations)
                {
                    if (location.Enable == false)
                        disabledReceiveLocations.Add(location);
                }
            }

            return disabledReceiveLocations;
        }

        public List<ReceiveLocation> GetReceiveLocations()
        {
            List<ReceiveLocation> receiveLocations = new List<ReceiveLocation>();

            foreach (ReceivePort receivePort in this._explorer.ReceivePorts)
            {
                foreach (ReceiveLocation receiveLocation in receivePort.ReceiveLocations)
                {
                    receiveLocations.Add(receiveLocation);
                }
            }

            return receiveLocations;
        }
    }
}